package com.myidis.mapper;

import java.util.ArrayList;

import org.apache.ibatis.annotations.*;

import com.myidis.entity.QuotaType;

public interface QuotaTypeMapper {
	@Select("SELECT * FROM quota_type")
    @Results({
    	@Result(property = "id", column = "id"),
    	@Result(property = "name", column = "name"),
        @Result(property = "description", column = "description")
    })
    ArrayList<QuotaType> all();
	
    @Select("SELECT * FROM quota_type WHERE id = #{id}")
    @Results({
    	@Result(property = "id", column = "id"),
    	@Result(property = "name", column = "name"),
        @Result(property = "description", column = "description")
    })
    QuotaType getOne(int id);
    
	@Insert("INSERT INTO quota_type(name, description) VALUES(#{name}, #{description})")
    int insert(QuotaType quotaType);

    @Insert("INSERT INTO quota_type(mark, name, description) VALUES(#{code}, #{name}, #{description})")
    void sinsert(@Param("mark") String mark, @Param("name")String name, @Param("description")String description);

    @Update("UPDATE quota_type SET id = #{id}, name = #{name}, description = #{description} WHERE id = #{id}")
    int update(QuotaType quotaType);

    @Delete("DELETE FROM quota_type WHERE id = #{id}")
    int delete(int id);


}
